home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / tcp / HyperMail102.lha / HyperMail / hypermail.h < prev    next >
C/C++ Source or Header  |  1995-06-18  |  3KB  |  149 lines

  1. /*
  2. ** Copyright (C) 1994, Enterprise Integration Technologies Corp.          
  3. ** All Rights Reserved.
  4. ** Kevin Hughes, kevinh@eit.com
  5. ** 7/31/94
  6. */
  7.  
  8. /*
  9. ** Additions done by Joop van de Wege, Joop.vandeWege@medew.ento.wau.nl
  10. ** 6/17/95
  11. */
  12.  
  13. #include "config.h"
  14. #define VERSION    "1.02"
  15. #define PROGNAME   "hypermail"
  16. #define HMURL      "http://www.eit.com/software/hypermail/hypermail.html"
  17. #define DIRNAME    "archive"
  18. #define INDEXNAME  "index.html"
  19. #define DATENAME   "date.html"
  20. #define THRDNAME   "thread.html"
  21. #define SUBJNAME   "subject.html"
  22. #define AUTHNAME   "author.html"
  23. #define NONAME     "(no name)"
  24. #define NODATE     "(no date)"
  25. #define NOEMAIL    "(no email)"
  26. #define NOSUBJECT  "(no subject)"
  27. #define MAXLINE       1000
  28. #define MAXFILELEN 100
  29. #define NAMESTRLEN 80
  30. #define NUMSTRLEN  10
  31. #define MAILSTRLEN 80
  32. #define DATESTRLEN 80
  33. #define MSGDSTRLEN 80
  34. #define REPYSTRLEN 240
  35. #define SUBJSTRLEN 100
  36. #define URLSTRLEN  100
  37. #define HASHSIZE   101
  38.  
  39. #define SHORTDATELEN   9
  40. #define TIMEZONELEN    10
  41. #define YEARLEN        5
  42. #define CENTURY        1900
  43. #define BASEYEAR       1970
  44. #define DAYSPERYEAR    365
  45. #define SECSPERMIN     60
  46. #define SECSPERHOUR    3600
  47. #define SECSPERDAY     86400
  48. #define IS_LEAP(y) (y > 1752 && (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)))
  49.  
  50. #include <stdio.h>
  51. #include <sys/types.h>
  52. #include <sys/stat.h>
  53. #include <stdlib.h>
  54.  
  55. #ifdef AMIGA
  56. #include <time.h>
  57. #else
  58. #include <pwd.h>
  59. #endif
  60.  
  61. #ifndef MAIN_FILE
  62. #define VAR extern
  63. #else
  64. #define VAR
  65. #endif
  66.  
  67. struct reply {
  68.     int msgnum;
  69.     int frommsgnum;
  70.     char *name;
  71.     char *subject;
  72.     int maybereply;
  73.     struct reply *next;
  74. };
  75.  
  76. struct body {
  77.     char *line;
  78.     struct body *next;
  79. };
  80.  
  81. struct printed {
  82.     int msgnum;
  83.     struct printed *next;
  84. };
  85.  
  86. struct email {
  87.     int msgnum;
  88.     char *name;
  89.     char *emailaddr;
  90.     char *fromdatestr;
  91.     char *datestr;
  92.     char *msgid;
  93.     char *subject;
  94.     char *inreplyto;
  95.     struct body *bodylist;
  96.     struct email *next;
  97. };
  98.  
  99. struct header {
  100.     int msgnum;
  101.     char *name;
  102.     char *subject;
  103.     char *datestr;
  104.     int datenum;
  105.     struct header *left;
  106.     struct header *right;
  107. };
  108.  
  109. VAR struct header *subjectlist;
  110. VAR struct header *authorlist;
  111. VAR struct header *datelist;
  112. VAR struct reply *replylist;
  113. VAR struct reply *threadlist;
  114. VAR struct printed *printedlist;
  115. VAR struct printed *printedthreadlist;
  116. VAR struct email *etable[HASHSIZE];
  117. VAR char timezonestr[TIMEZONELEN];
  118. VAR char thisyear[YEARLEN];
  119. VAR char datename[NAMESTRLEN];
  120. VAR char thrdname[NAMESTRLEN];
  121. VAR char subjname[NAMESTRLEN];
  122. VAR char authname[NAMESTRLEN];
  123. VAR char errmsg[MAXLINE];
  124. VAR int firstdatenum;
  125. VAR int lastdatenum;
  126. VAR int bignum;
  127. VAR int showprogress;
  128. VAR int reverse;
  129. VAR int showheaders;
  130. VAR int showhtml;
  131. VAR int thrdlevels;
  132. VAR int dirmode;
  133. VAR int filemode;
  134.  
  135. #ifdef MAIN_FILE
  136. char *urls[] = { "http://", "gopher://", "file://", "ftp://",
  137.     "wais://", "telnet://", "news:", "mailto:", NULL };
  138. char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
  139.         "Aug", "Sep", "Oct", "Nov", "Dec" };
  140. char *days[] = { "Sun ", "Mon ", "Tue ", "Wed ", "Thu ", "Fri ", "Sat ", NULL };
  141. char monthnums[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  142.         '0', '1', '2' };
  143. int monthdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 30, 30, 31 };
  144. #else
  145. extern char *urls[], *months[], *days[];
  146. extern char monthnums[];
  147. extern int monthdays[];
  148. #endif
  149.